Application program interface (API) facilitating decoder control of accelerator resources

ABSTRACT

A method comprising receiving a command from a decoder application at an application program interface (API), and generating a data structure, recognizable by a communicatively coupled accelerator including one or more parameters which, when received by the accelerator, affects one or more filter settings of the accelerator.

RELATED APPLICATIONS

This application claims priority to a provisional application entitledAn Adaptive Multimedia Application Interface, Ser. No. 60/198,938, filedon Apr. 21, 2000 by Sullivan, et al. and commonly assigned to theassignee of the present invention.

TECHNICAL FIELD

This invention generally relates to video processing and, in particular,to a multimedia application program interface (API) that automaticallyidentifies and dynamically adapts to processing system capability toimprove multimedia processing performance.

BACKGROUND OF THE INVENTION

With recent improvements in processing and storage technologies, manypersonal computing systems now have the capacity to receive, process andrender multimedia objects (e.g., audio, graphical and video content).The multimedia content may be delivered to the computing system in anyof a number of ways including, for example, on a compact disk read-onlymemory (CD-ROM), a digital versatile disk read-only memory (DVD-ROM),via a communicatively coupled data network (e.g., Internet), and thelike. Due to the amount of data required to accurately represent suchmultimedia content, it is typically delivered to the computing system inan encoded, compressed form. To render the multimedia, it must bedecompressed and decoded before it is communicated to a display and/oraudio device.

A number of multimedia standards have been developed that define theformat and meaning of encoded multimedia content for purposes ofdistribution. Organizations such as the Moving Picture Experts Group(MPEG) under the auspices of the International Standards Organization(ISO), and the Video Coding Experts Group (VCEG) under the auspices ofthe International Telecommunications Union (ITU), have developed anumber of multimedia coding standards, e.g., MPEG-1, MPEG-2, MPEG-4,H.261, H.263, and the like. Such standards define the format and meaningof the coded multimedia content, but not how the encoded content is togenerated, and only defines the decoding process in mathematical terms.Consequently, a number of hardware and software solutions have beendeveloped by a number of companies to encode, decode and rendermultimedia content, often employing proprietary techniques to recoverthe multimedia content from a particular standardized format.

Simplistically speaking, the encoding process removes spatial andtemporal redundancies from the media content, thereby reducing theamount of data needed to represent the media content and, as a result,reducing the bandwidth burden to store and/or transmit such mediacontent. A common encoding process includes a digitization/filteringstage, a prediction stage, and a transformation and difference codingstage. In the digitization/filtering stage, the received analog mediacontent is digitized using, for example, an analog to digital converterand is filtered to remove artifacts. In the prediction stage, spatialand temporal redundancies are identified and removed/reduced usingmotion estimation prediction techniques. The transformation anddifference coding process involves a transformation filtering step(e.g., Discrete Cosine Transform (DCT)), followed by a quantization stepand entropy encoding.

Conversely, the decoding process is, simplistically speaking, an inverseof the coding process, e.g., entropy decoding, motion compensatedprediction, inverse quantization, inverse transformation, and additionof the inverse transformed result to the prediction. For rendering, anadditional step of digital to analog conversion (with filtering) canthen be performed to generate an approximate representation of theoriginal analog media signal. It will be appreciated by those skilled inthe art that media encoding/decoding is a computationally complexprocess. A common approach within personal computing devices is to splitthe decoding process between a decoder application executing on the hostprocessor of the computing system, and a multimedia accelerator. Often,the decoder application provides the front-end processing, i.e.,performing some initial decoding (buffering, inverse quantization, etc.)and controlling the overall decoding process. The multimedia acceleratoris a functional unit, which executes computationally intensive butrepetitive high rate operations in the decoding process, i.e., themotion compensated prediction (MCP) process, the inverse discrete cosinetransform (IDCT), and display format conversion operations.

In such implementations, where multimedia decoding is split between asoftware component (e.g., the decoder executing on a host processor) anda hardware accelerator, a multimedia application program interface (API)is typically employed as a functional interface between the decoderapplication and the accelerator. Those skilled in the art willappreciate that an API comprises the functions, messages (commands),data structures and data types used in creating applications that rununder an operating system. The multimedia API is typically developed byhardware vendors of the accelerators to enable their hardware tointerface with particular decoder applications. In this regard, priorart solutions often required the accelerator hardware vendors to developan API to interface their board with any of a plurality of decoderapplications that an end-user may employ to control and rendermultimedia content.

As introduced above, however, each manufacturer of multimedia decodingapplications/accelerators has taken an individual proprietary approachto decoding multimedia content. That is, each of the decoderapplications and multimedia accelerators available in the market offerdifferent levels of functionality, often utilizing different dataformats or APIs to expose the same basic capability. One accelerator mayprovide the inverse transformation (e.g., IDCT) as well as motioncompensated prediction capability, while another (perhaps lower-end)multimedia accelerator will rely on the host-based decoder applicationto perform the inverse transformation process and merely provide themotion compensated prediction and/or display format conversion.Consequently, each decoder application/multimedia acceleratorcombination is a unique multimedia processing system, which heretoforehas required a dedicated API.

Another negative consequence of the API proliferation associated witheach multimedia accelerator is that it is often necessary or desirableto make changes to the multimedia accelerator—improve processingcapability, alter processing techniques, accommodate processingimprovements, accommodate developments in computing system technology,etc. Heretofore, whenever such changes were made to the accelerator, achange was necessitated in one or more of the API's associated with theaccelerator. In addition to the increased likelihood for theproliferation of unnecessary API's in the end-user's computing system(which may adversely affect system performance), this also unnecessarilycomplicates the task of writing a decoder application which is intendedto use the acceleration capabilities, potentially rendering the decoderincompatible with some accelerators.

Thus, an adaptive multimedia application program interface thattranscends particular software and hardware characteristics is needed,unencumbered by the above limitations commonly associated with the priorart.

SUMMARY OF THE INVENTION

This invention concerns a multimedia application program interface (API)facilitating the use of any one or more of a plurality of multimediaaccelerators with a decoder application. According to a firstimplementation of the present invention, a method comprising receiving acommand from a decoder application at an application program interface(API), and generating a data structure, recognizable by acommunicatively coupled accelerator including one or more parameterswhich, when received by the accelerator, affects one or more filtersettings of the accelerator.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an example computer system incorporatingthe teachings of the present invention;

FIG. 2 is a block diagram of an example multimedia application programinterface (API) incorporating the teachings of the present invention,according to one implementation of the present invention;

FIGS. 3 and 4 provide a graphical illustration of an example controlcommand data structure and a residual difference data structure,respectively, according to one aspect of the present invention;

FIG. 5 is a flow chart of an example method interfacing any decoderapplication with any accelerator without a priori knowledge of thedecoder or accelerator to be used, according to one implementation ofthe present invention;

FIG. 6 is a flow chart of an example method of decoding media content,according to one example implementation of the present invention;

FIG. 7 is a flow chart of an example method facilitating host-basedentropy decoding, according to one aspect of the present invention;

FIG. 8 is a flow chart of an example method facilitating applicationcontrol of an accelerator deblocking filter, in accordance with oneaspect of the present invention;

FIG. 9 is a block diagram of an example multimedia API, according to analternate implementation of the present invention; and

FIG. 10 is a block diagram of an example storage medium comprising aplurality of executable instructions that when executed implement themultimedia API of the present invention, according to one embodiment ofthe present invention.

DETAILED DESCRIPTION

This invention concerns an application program interface (API) thatdynamically adapts to the processing capability of a multimediaprocessing system to improve multimedia processing performance. In thisregard, the present invention is an enabling technology that facilitatesinnovation in multimedia processing (e.g., encoding and decoding ofmedia content). For ease of illustration and explanation, and notlimitation, the teachings of the present invention will be developedwithin the implementation context of a video decoding system. As such,certain aspects of video decoding process(es) will be described in thecontext of the present invention. Thus, it is expected that the readerbe generally familiar with multimedia decoding. In particular,familiarity with one or more of the H.261, MPEG-1, H.262/MPEG-2, H.263,and MPEG-4 standards will be useful in understanding the operationalcontext of the present invention:

ITU-T Recommendation H.261: Video Codec for Audiovisual Services at Px64kbit/s, 1993.

ISO/IEC 11172-2 (MPEG-1 Video): Information technology—Coding of movingpictures and associated audio for digital storage media at up to about1,5 Mbit/s—Part 2: Video, 1993.

ITU-T Recommendation H.262/ISO/IEC 13818-2 (MPEG-2 Video): Informationtechnology—Generic coding of moving pictures and associated audioinformation: Video, 1995.

ITU-T Recommendation H.263: Video coding for low bit rate communication,1995; version 2, 1998; version 3, 2000.

ISO/IEC 14496-2 (MPEG-4 Visual): Information technology—Coding ofaudio-visual objects—Part 2: Visual, 1999.

As such, the foregoing standards are expressly incorporated herein byreference for the purpose of illustrating certain aspects of thedecoding process.

It is to be appreciated, however, that the scope of the presentinvention extends well beyond the particular implementations described.In describing the present invention, example network architectures andassociated methods will be described with reference to the abovedrawings. It is noted, however, that modification to the architectureand methods described herein may well be made without deviating fromspirit and scope of the present invention. Indeed, such alternateembodiments are anticipated.

Terminology

It is to be appreciated that those skilled in the art employ variousterms of art when describing certain aspects of multimedia content, theencoding and/or decoding process. While one skilled in the art isgenerally familiar with such terms, a brief list of terminology employedthroughout the specification is provided to facilitate understanding ofcontext and detail of the present invention.

BPP—a parameter specifying the number of bits per sample, e.g., eight(8). component—one of three color channels {Y, Cb, Cr}.

host CPU—programmable processor which controls overall function of acomputing environment (high level operations).

decoder—an aspect of a media processing system; an application typicallyexecuting on a host CPU to perform one or more video decoding functions.

accelerator—an aspect of a media processing system; a functional unitwhich executes computationally intensive, but high rate operations suchas IDCT, MCP, display format conversion.

inverse discrete cosine transform (IDCT)—a transformation operation usedas part of a video decoding process.

motion compensated prediction (MCP)—the stage of a video decodingprocess involving prediction of the values of a new picture usingspatially-shifted areas of content from previously-decoded pictures.

media processing system—one or more elements which process (i.e., encodeand/or decode) media content in accordance with a coding standard.

intra—representation of picture content without prediction using anypreviously-decoded picture as a reference.

inter—representation of picture content by first encoding a predictionof an area of the picture using some previously-decoded picture and thenoptionally adding a signal representing the deviation from thatprediction.

residual difference decoding—decoding of the waveform which representsthe error signal which has been encoded to represent whatever signalremains after motion-compensated prediction as appropriate. This mayentail simply an “intra” representation of a non-predicted waveform oran “inter” difference after prediction.

4:2:0 sampling—a method of representing an image using twice as manyluminance (Y) samples, both horizontally and vertically, relative to thenumber of is samples used for the chrominance (Cb and Cr) components.

macroblock—a set of data comprising the samples necessary to represent aparticular spatial region of picture content, including one or moreblocks of all color channel components of a video signal. For example,current video coding standards often use 4:2:0 sampling with macroblocksconsisting of four 8×8 blocks of Y component data and one 8×8 block ofCb and one 8×8 block of Cr data to represent each 16×16 area of picturecontent.

globally-unique identifier (GUID)—a 128-bit number used as a unique itemidentity indication.

Example Computer System

In the discussion herein, the invention is introduced in the generalcontext of computer-executable instructions, such as program modules,application program interfaces, and the like, being executed by one ormore computing devices. Generally, such application program interfaces,program modules and the like include routines, programs, objects,components, data structures, etc. that perform particular tasks orimplement particular abstract data types. Moreover, those skilled in theart will appreciate that the invention may be practiced with any of anumber of alternate computing devices/computing configurationsincluding, for example, a personal computer, hand-held devices, personaldigital assistants (PDA), a KIOSK, multiprocessor systems,microprocessor-based or programmable consumer electronics, network PCs,minicomputers, mainframe computers, and the like. In a distributedcomputer environment, program modules may be located in both local andremote memory storage devices. It is to be appreciated, however, thatthe present invention may alternatively be implemented in hardware suchas, for example, a microcontroller, a processor, an application specificintegrated circuit (ASIC), a field-programmable gate array (FPGA), aprogrammable logic device (PLD), and the like.

FIG. 1 shows a general example of a computing system 102 incorporatingthe teachings of the present invention. It will be evident, from thediscussion to follow, that computer 102 is intended to represent any ofa class of general or special purpose computing platforms which, whenendowed with the innovative multimedia application program interface(API) 104, implement the teachings of the present invention. In thisregard, the following description of computer system 102 is intended tobe merely illustrative, as computer systems of greater or lessercapability may well be substituted without deviating from the spirit andscope of the present invention.

As shown, computer 102 includes one or more processors or processingunits 132, a system memory 134, and a bus 136 that couples varioussystem components including the system memory 134 to processors 132.

The bus 136 represents one or more of any of several types of busstructures, including a memory bus or memory controller, a peripheralbus, an accelerated graphics port (AGP), and a processor or local bususing any of a variety of bus architectures. According to oneimplementation, a decoder application executing on processing unit 132communicates with a video accelerator via the Personal ComputerInterface Accelerated Graphics Port (PCI/AGP) bus. The system memoryincludes read-only memory (ROM) 138 and random access memory (RAM) 140.A basic input/output system (BIOS) 142, containing the basic routinesthat help to transfer information between elements within computer 102,such as during start-up, is stored in ROM 138. Computer 102 furtherincludes a hard disk drive 144 for reading from and writing to a harddisk, not shown, a magnetic disk drive 146 for reading from and writingto a removable magnetic disk 148, and an optical disk drive 150 forreading from or writing to a removable optical disk 152 such as a CDROM, DVD ROM or other such optical media.

The hard disk drive 144, magnetic disk drive 146, and optical disk drive150 are connected to the bus 136 by a SCSI interface 154 or some othersuitable bus interface. The drives and their associatedcomputer-readable media provide nonvolatile storage of computer readableinstructions, data structures, program modules and other data forcomputer 102.

Although the exemplary environment described herein employs a hard disk144, a removable magnetic disk 148 and a removable optical disk 152, itshould be appreciated by those skilled in the art that other types ofcomputer readable media which can store data that is accessible by acomputer, such as magnetic cassettes, flash memory cards, digital videodisks, random access memories (RAMs) read only memories (ROM), and thelike, may also be used in the exemplary operating environment.

A number of program modules may be stored on the hard disk 144, magneticdisk 148, optical disk 152, ROM 138, or RAM 140, including an operatingsystem 158, one or more application programs 160, other program modules162, and program data 164. According to one implementation of thepresent invention, operating system 158 includes a multimediaapplication program interface 104 of the present invention, tocharacterize the processing capability of one or more communicativelycoupled multimedia accelerators, and to negotiate processing of receivedmultimedia content between a decoder application and the accelerator(s)based, at least in part, on the identified capability of theaccelerator(s). In this regard, the innovative multimedia API 104 adaptsmultimedia processing of the host system to accommodate identifiedaccelerator peripherals, enabling any multimedia application executingon the host system to interface with any multimedia accelerator, withoutrequiring an application/accelerator-specific API.

A user may enter commands and information into computer 102 throughinput devices such as keyboard 166 and pointing device 168. Other inputdevices (not shown) may include a microphone, joystick, game pad,satellite dish, scanner, or the like. These and other input devices areconnected to the processing unit 132 through an interface 170 that iscoupled to bus 136. A monitor 172 or other type of display device isalso connected to the bus 136 via an interface, such as a video adapter174. In addition to the monitor 172, personal computers often includeother peripheral output devices (not shown) such as speakers andprinters.

As shown, computer 102 operates in a networked environment using logicalconnections to one or more remote computers, such as a remote computer176. The remote computer 176 may be another personal computer, apersonal digital assistant, a server, a router or other network device,a network “thin-client” PC, a peer device or other common network node,and typically includes many or all of the elements described aboverelative to computer 102, although only a memory storage device 178 hasbeen illustrated in FIG. 1.

As shown, the logical connections depicted in FIG. 1 include a localarea network (LAN) 180 and a wide area network (WAN) 182. Suchnetworking environments are commonplace in offices, enterprise-widecomputer networks, Intranets, and the Internet. In one embodiment,remote computer 176 executes an Internet Web browser program such as the“Internet Explorer” Web browser manufactured and distributed byMicrosoft Corporation of Redmond, Washington to access and utilizeonline services.

When used in a LAN networking environment, computer 102 is connected tothe local network 180 through a network interface or adapter 184. Whenused in a WAN networking environment, computer 102 typically includes amodem 186 or other means for establishing communications over the widearea network 182, such as the Internet. The modem 186, which may beinternal or external, is typically connected to the bus 136 via a serialport interface 156. In a networked environment, program modules depictedrelative to the personal computer 102, or portions thereof, may bestored in the remote memory storage device. It will be appreciated thatthe network connections shown are exemplary and other means ofestablishing a communications link between the computers may be used.

Generally, the data processors of computer 102 are programmed by meansof instructions stored at different times in the variouscomputer-readable storage media of the computer. Programs and operatingsystems are typically distributed, for example, on floppy disks orCD-ROMs. From there, they are installed or loaded into the secondarymemory of a computer. At execution, they are loaded at least partiallyinto the computer's primary memory. The invention described hereinincludes these and other various types of computer-readable storagemedia when such media contain instructions or programs for implementingthe innovative steps described below in conjunction with amicroprocessor or other data processor. The invention also includes thecomputer itself when programmed according to the methods and techniquesdescribed below. Furthermore, certain is sub-components of the computermay be programmed to perform the functions and steps described below.The invention includes such sub-components when they are programmed asdescribed. In addition, the invention described herein includes datastructures, described below, as embodied on various types of memorymedia.

For purposes of illustration, programs and other executable programcomponents such as the operating system are illustrated herein asdiscrete blocks, although it is recognized that such programs andcomponents reside at various times in different storage components ofthe computer, and are executed by the data processor(s) of the computer.

Example API Architecture and Functional Relationships

FIG. 2 illustrates a block diagram of an example architecture for anadaptive multimedia API 104, as well as the functional relationships ofAPI 104 to multimedia accelerator(s) 174 and decoder application(s) 160.According to the illustrated example embodiment, adaptive multimedia API104 facilitates communication between a host processing unit 132, whichexecutes one or more decoder applications (e.g., 160A-N) to renderreceived multimedia content for a user, and one or more multimediaaccelerator's 174A-N. According to one aspect of the invention, to bedescribed more fully below, API 104 is not specific to any particularmultimedia application 160A-N, host processor 132 and/or multimediaaccelerator 174A-N (cumulatively referred to as a multimedia processingsystem). Unlike prior art multimedia API's which are designed to workwith a particular media processing system, API 104 identifies theoperational capability of one or more of the multimedia processingsystem elements and selectively negotiates the processing of receivedmultimedia content across these elements to improve multimediaprocessing performance. Thus, API 104 may be utilized to facilitate theinteroperability of any decoder application with any video decoderaccelerator.

As introduced above, in general, an API may well comprise one or more ofexecutable functions, messages, data structures and data types thatenable an application to interface with one or more hardware devices.Thus, according to the illustrated example embodiment of FIG. 2,multimedia API 104 is comprised of one or more data structures includingone or more auto-negotiation data structure(s) 202 and one or moreoperational data structure(s) 204.

According to one aspect of the present invention, to be described morefully below, the auto-negotiation data structure(s) 202 of API 104 areselectively invoked by a media processing system element to identify themedia processing capability of the media processing system, whereuponAPI 104 selects one or more operational data structure(s) 204appropriate to facilitate the negotiated processing of the media amongand between the processing system elements. In this regard, API 104facilitates the processing of media content without a priori knowledgeof the processing capability of the elements comprising the mediaprocessing system.

Auto-negotiation Data Structure(s)

As used herein, the auto-negotiation data structure(s) 202 are a seriesof commands, invoked in an iterative fashion by a decoder application,for example, to identify the media decoding capability of anaccelerator. According to one implementation of the present invention,the auto-negotiation data structure(s) include (1) a ConnectMode datastructure, and (2) a ConnectConfig data structure. According to oneimplementation, the ConnectMode data structure specifies a proposed modeof operation and/or a proposed video decode format (e.g., MPEG-1,MPEG-2, etc.). A number of alternate modes of operation may well beimplemented and defined within the ConnectMode data structure(s) suchas, for example, an MPEG-2 mode wherein the API only invokes those dataformats necessary for MPEG-2 decoding without further negotiation ofother data formats, a protected mode (i.e., utilizing encryptedcommunication between the decoder and the accelerator), or a normal mode(i.e., non-restricted, non-protected).

The ConnectConfig data structure provides information on how the API 104is to be configured to decode the video in accordance with the videoformat identified in the ConnectMode data structure. According to oneillustrative example, the ConnectConfig data structure includesinformation regarding intermediate data formats to be used (if any),which aspects of the decoding process will reside on the host versus theaccelerator, and the like. According to one embodiment, the ConnectModeand ConnectConfig data structures are iteratively passed between thedecoder and the accelerator utilizing a ConnectInfo command, e.g.,ConnectInfo {ConnectMode, ConnectConfig}. The ConnectMode andConnectConfig data structures can be looked upon as two “orthogonal”aspects of codec construction between the decoder software and videoaccelerator driver.

According to one implementation, decoder 160 issues the ConnectInfocommand with one of a number of ConnectMode and ConnectConfigcombinations, to accommodate any of a number of multimedia codecs. Ifthe accelerator 174 does not support a particularConnectMode/ConnectConfig combination, a negative response to theConnectInfo command is sent to the decoder 160. If, however, theaccelerator 174 does support the Mode/Config combination, a positiveresponse is issued to decoder 160, as API 104 selects appropriate onesof the operational data structure(s) 204 to facilitate the decoding ofthe multimedia in the mutually agreed upon format. According to oneimplementation, API 104 selects a ConnectMode/ConnectConfig combinationreflecting the MPEG-2 main profile, main level with host-based IDCT as adefault proposal, followed by other combinations. Example ConnectModeand ConnectConfig parameters are introduced with reference to Table Iand Table II, respectively, below.

TABLE I Example ConnectMode Data Structure Settings ConnectMode {ModeGUID (128b; The Global ID of the Intended Mode) dwRestrictedMode(16b; Restricted Mode ID) }

As introduced in Table I, above, the ConnectMode data structure passesthe GUID of a proposed mode of operation. In addition, in accordancewith the illustrated example embodiment, a restricted mode may also benegotiated within the ConnectMode data structure.

TABLE II Example ConnectConfig Data Structure Parameters ConnectConfig {//Encryption GUIDs ConfigBitstreamEncryptionGUIDConfigMBcontrolEncryptionGUID ConfigRsidDiffEncryptionGUID //BitstreamProcessing Indicator ConfigBitstreamRaw //Macroblock ControlConfiguration ConfigMBcontrolRaasterOrder //Host Residual DifferenceConfiguration ConfigResidDiffHost ConfigSpatialResid8ConfigOverflowBlocks ConfigResid8SubtractionConfigSpatialHost8or9Clipping //Accelerator Residual DifferenceConfiguration ConfigResidDiffAccelerator ConfigHostlnverseScanConfigSpecificIDCT }

With reference to Table II, a number of operational parameters arenegotiated within the ConnectConfig data structure including, but notlimited to, encryption parameters, bitstream processing indicator,macroblock control configuration information, host residual differenceconfiguration information and accelerator residual differenceconfiguration information. An example implementation of each of theConnectConfig parameters are introduced, below.

ReservedBits: Any field in this specification having the nameReservedBits as its name or part of its name is not presently used inthis specification and shall have the value zero.

guidConfigBitstreamEncryption: Indicates a GUID associated with theencryption protocol type for bitstream data buffers. The valueDXVA_NoEncrypt (a GUID name defined in the associated header file)indicates that encryption is not applied. Shall be DXVA_NoEncrypt ifConfigBitstreamRaw is 0.

guidConfigMBcontrolEncryption: Indicates a GUID associated with theencryption protocol type for macroblock control data buffers. The valueDXVA_NoEncrypt (a GUID name defined in the associated header file)indicates that encryption is not applied. Shall be DXVA_NoEncrypt ifConfigBitstreamRaw is 1.

guidConfigResidDiffEncryption: Indicates a GUID associated with theencryption protocol type for residual difference decoding data buffers(buffers containing spatial-domain data or sets of transform-domaincoefficients for accelerator-based IDCT). The value DXVA_NoEncrypt (aGUID name defined in the associated header file) indicates thatencryption is not applied. Shall be DXVA_NoEncrypt if ConfigBitstreamRawis 1.

ConfigBitstreamRaw: A value of “1” specifies that the data for thepictures will be sent in bitstream buffers as raw bitstream content, anda value of “0” specifies that picture data will be sent using macroblockcontrol command buffers. An intermediate-term requirement is to support“0”. Additional support of “1” is desired.

ConfigMBcontrolRasterOrder: A value of “1” specifies that the macroblockcontrol commands within each macroblock control command buffer shall bein raster-scan order, and a value of “0” indicates arbitrary order. Forsome types of bitstreams, forcing raster order will either greatlyincrease the number of required macroblock control buffers that must beprocessed or will require host reordering of the control information.Support of arbitrary order can thus be advantageous for the decodingprocess. For example, H.261 CIF-resolution decoding can require 36macroblock control buffers per picture if raster-scan order is necessarywithin each buffer (H.263 Annex K's arbitrary slice ordering andrectangular slice modes have similar repercussions.) Anintermediate-term requirement is to support “0”. Additional support of“1” is desired.

ConfigResidDiffHost: A value of “1” specifies that some residualdifference decoding data may be sent as blocks in the spatial domainfrom the host, and a value of “0” specifies that spatial domain datawill not be sent. Shall be “0” if ConfigBitstreamRaw is “1”. Anintermediate-term requirement is to support “1”, which is the preferredvalue.

ConfigSpatialResid8: A value of “1” indicates that host residualdifference spatial-domain blocks of prediction residual data forpredicted pictures will be sent using 8 bit signed samples, and a valueof “0” indicates that such blocks are sent using 16 bit signed samples.(For intra macroblocks, these signed samples are sent relative to aconstant reference value of 2^(BPP−1).) Shall be “0” ifConfigResidDiffHost is “0”.

ConfigOverflowBlocks: A value of “1” indicates that host residualdifference spatial blocks of prediction residual data for predictedpictures may be sent using 8 bit signed “overflow” blocks in a secondpass for each macroblock rather than sending only one set of signedblock data, and a value of “0” indicates that such overflow blocks shallnot be sent (instead using a second complete pass for any necessaryoverflow blocks, such as a “read-modify-write” picture as describedbelow). Shall be “0” if ConfigSpatialResid8 is “0”. WhenConfigSpatialResid8 is “1”, a value of “1” for ConfigOverflowBlocks isconsidered preferred over a value of “0”, as it prevents the need fortwo complete macroblock control command passes to create a single outputpicture. An intermediate-term requirement is support of “1” ifConfigSpatialResid8=“1” is supported.

ConfigResid8Subtraction: A value of “1” when ConfigSpatialResid8 is “1”indicates that 8-bit differences can be subtracted rather than added.Shall be “0” unless ConfigSpatialResid8 is “1”. If “1” withConfigOverflowBlocks equal to “1”, this indicates that any overflowblocks will be subtracted rather than added. If “1” withConfigOverflowBlocks equal to “0”, this indicates that frames may besent with single-pass subtracted 8-bit spatial differences. Anintermediate-term requirement is to support “1” if ConfigSpatialResid8is “1”.

ConfigSpatialHost8 or 9 Clipping: A value of “1” indicates thatspatial-domain intra blocks shall be clipped to an 8-bit range on thehost and that spatial-domain inter blocks shall be clipped to a 9-bitrange on the host, and a value of “0” indicates that any necessaryclipping is performed on the accelerator. An intermediate-termrequirement is to support “0”. Nearer-term support of “1” is allowed butless preferred, and is considered a lower level of acceleratorcapability.

ConfigSpatialResidInterleaved: A value of “1” when ConfigResidDiffHostis “1” and the YUV format is “NV12” or “NV21” indicates that anyspatial-domain residual difference data shall be sent in achroma-interleaved form matching the YUV format chroma interleavingpattern. Shall be “0” unless ConfigResidDiffHost is “1” and the YUVformat is “NV12” or “NV21”. An intermediate-term requirement is tosupport “0”. Nearer-term support of “1” is allowed but less preferred,and is considered a lower level of accelerator capability.

ConfigResidDiffAccelerator: A value of “1” indicates thattransform-domain blocks of coefficient data may be sent from the hostfor accelerator-based IDCT, and a value of “0” specifies thataccelerator-based IDCT will not be used. If both ConfigResidDiffHost andConfigResidDiffAccelerator are “1”, this indicates that some residualdifference decoding will be done on the host and some on theaccelerator, as indicated by macroblock-level control commands. Shall be“0” if ConfigBitstreamRaw is “1”. Support for ConfigResidDiffAcceleratorequal to “1” is desired, but there is not expected to be anintermediate-term requirement for this support. Support forConfigResidDiffAccelerator being “1” with ConfigResidDiffHost also being“1” indicates that the residual difference decoding can be sharedbetween the host and accelerator on a macroblock basis, and isconsidered an even higher level of accelerator capability thanConfigResidDiffAccelerator being “1” with ConfigResidDiffHost being “0”.

ConfigHostInverseScan: A value of “1” indicates that the inverse scanfor transform-domain block processing will be performed on the host, andabsolute indices will be sent instead for any transform coefficients,and a value of “0” indicates that inverse scan will be performed on theaccelerator. Shall be “0” if ConfigResidDiffAccelerator is “0”. Anintermediate-term expected requirement is to support “1” ifConfigResidDiffAccelerator is “1”. Nearer-term support of “0” is allowedbut less preferred, and is considered a lower level of acceleratorcapability.

ConfigSpecificIDCT: A value of “1” indicates use of the IDCT specifiedin ITU-T H.263 Annex W, and a value of “0” indicates that any compliantIDCT can be used for off-host IDCT. Shall be zero ifConfigResidDiffAccelerator is “0” (indicating purely host-based residualdifference decoding). An intermediate-term expected requirement is tosupport “0” if ConfigResidDiffAccelerator is “1”. Additional support of“1” is desired and is considered a higher level of acceleratorcapability.

Operational Data Structure(s)

In addition to the auto-negotiation data structure(s) 202, API 104 alsoincludes one or more operational data structure(s) 204. As introducedabove, one or more of the operational data structure(s) 204 areselectively invoked by API 104 to facilitate the communication requiredto effect the negotiated division in media decoding among and betweenmedia processing system elements (e.g., decoder application andaccelerator). In accordance with the illustrated example embodiment of avideo decoding system, the operational data structure(s) 204 includepicture level parameters and/or buffer structure for macroblocks of apicture. The picture level parameters the buffer structure required formedia decoding depends, at least in part, on which elements of the mediaprocessing system will are to perform the various decoding tasks.According to one implementation, API 104 facilitates configuration of anumber of picture level parameter(s) (see, e.g., Table III below), anddynamically adapts buffer structure(s) to accommodate Pre-IDCTsaturation, Mismatch Control, IDCT, Picture Reconstruction, andReconstruction Clipping (each of which are discussed in turn, below).

Picture-Level Parameters

One or more picture level parameters are sent using a PictureParameters{} command within the operational data structure 204 defining a number ofpicture-level variables once per picture between decoder application andthe accelerator. In accordance with the illustrated example embodiment,the picture level parameters of the operational data structure describeone or more aspects of the picture to be decoded such as, for example,one or more picture indices (e.g., decoded picture index, deblockedpicture index, etc.), the picture encoding type (e.g., intra-encoded,inter-encoded, etc.), and the like. An example of set of picture levelparameters are provided with reference to Table III, below.

TAB III Example Picture-level Parameters PictureParameters {DecodedPictureIndex DeblockedPictureIndex SubpictureBlendedIndexForwardRefPictureIndex BackwardRefPictureIndex IntraPicture BPPminus1SecondField SubpictureControlPresent ReservedBits MacroblockWidthMinus1MacroblockHeightMinus1 BlockWidthMinus1 BlockHeightMinus1PicWidthInMinus1 BlockHeightInMinus1 ChromaFormat PicStructure RcontrolBidirectionalAveragingMode MVprecisionAndChromaRelation ReservedBitsPicSpatialResid8 PicOverflowBlocks PicResid8Subtraction PicExtrapolationPicDeblocked Pic4Mvallowed PicOBMC PicBinPB MV_RPS PicDeblockedConfinedPicReadbackRequests ReservedBits PicScanFixed PicScanMethod ReservedBitsPicResampleOn PicResampleBefore PicResampleRcontrol ReservedBitsPicResampleSourcePicIndex PicResampleDestPicIndexPicResampleSourceWidthMinus1 PicResampleSourceHeightMinus1PicResampleDestWidthMinus1 PicResampleDestHeightMinus1PicResampleFullDestWidthMinus1 PicResampleFullDestHeightMinus1 }

In accordance with one example implementation, each of the foregoingparameters will be defined, in turn, below:

DecodedPictureIndex: Specifies destination frame buffer for the decodedmacroblocks.

DeblockedPictureIndex: Specifies destination frame buffer for thedeblocked output picture when bPicDeblocked=1. Has no meaning and shallbe zero if bPicDeblocked=0. May be the same as wDecodedPictureIndex.

SubpictureBlendedIndex: Specifies destination frame buffer for theoutput picture after blending with a DVD subpicture. Subpicture blendingshall occur after deblocking if applicable. Shall be equal towDeblockedPictureIndex or wDecodedPictureIndex as applicable if nosubpicture blending is required for the picture.

ForwardRefPictureIndex: Specifies the frame buffer index of the pictureto be used as a reference picture for “forward prediction” of thecurrent picture. Shall not be the same as DecodedPictureIndex unless allmotion prediction for the current picture uses forward motion withzero-valued motion vectors and no macroblocks are sent as intra andPicSpatialResid8 is 1 and PicOverflowBlocks is 0 andPicResid8Subtraction is 1. NOTE: The ability for wForwardRefPictureIndexto be set equal to wDecodedPictureIndex if all motion prediction usesforward prediction with zero-valued motion vectors is provided to allowprocessing of 8-bit difference pictures (see PicSpatialResid8,PicOverflowBlocks, and PicResid8Subtraction below) by a two-picture passprocess—one pass of decoding to perform motion compensation and to addthe first set of 8-bit differences, and a second pass to perform“read-modify-write” operations to subtract a second set of 8-bitdifferences and obtain the final result.

BackwardRefPictureIndex: Specifies the frame buffer index of the pictureto be used as a reference picture for “backward prediction” of thecurrent picture. Shall not be the same as DecodedPictureIndex ifbackward reference motion prediction is used.

IntraPicture: Indicates whether motion prediction is needed for thispicture. If IntraPicture=1, no motion prediction is performed for thepicture. Otherwise, motion prediction information shall be sent for thepicture.

BPPminus1: Specifies the number of bits per pixel for the video samplevalues. This shall be at least 7. It is equal to 7 for MPEG-1, MPEG-2,H.261, and H.263. A larger number of bits per pixel is supported in someoperational modes of MPEG-4. A derived term called BPP is formed byadding one to bBPPminus1.

SecondField: Indicates whether, in the case of field-structured motionprediction, the current field is the second field of a picture. This isused to determine whether motion compensation prediction is performedusing the reference picture or the opposite-parity field of the currentpicture.

SubpictureControlPresent: Indicates whether a subpicture control bufferis sent for the current picture.

MacroblockWidthMinus1: Specifies the destination luminance sample widthof a macroblock. This is equal to 15 for MPEG-1, MPEG-2, H.263, andMPEG-4. A derived term called MacroblockWidth is formed by adding one toMacroblockWidthMinus1.

MacroblockHeightMinus1: Specifies the destination luminance sampleheight of a macroblock. This is equal to 15 for MPEG-1, MPEG-2, H.261,H.263, and MPEG-4. A derived term called MacroblockHeight is formed byadding one to MacroblockHeightMinus1.

BlockWidthMinus1: Specifies the block width of an residual differenceblock. This is equal to 7 for MPEG-1, MPEG-2, H.261, H.263, and MPEG-4.Residual difference blocks within a macroblock are sent in the orderspecified as in H.262 FIGS. 6-10, 6-11, and 6-12 (raster-scan order forY, followed by all 4:2:0 blocks of Cb in raster-scan order, followed by4:2:0 blocks of Cr, followed by 4:2:2 blocks of Cb, followed by 4:2:2blocks of Cr, followed by 4:4:4 blocks of Cb, followed by 4:4:4 blocksof Cr). A derived term called W_(T) is formed by adding one toBlockWidthMinus1.

BlockHeightMinus1: Specifies the block height of an IDCT block. This isequal to 7 for MPEG-1, MPEG-2, H.261, H.263, and MPEG-4. A derived termcalled H_(T) is formed by adding one to BlockHeightMinus1.

PicWidthInMBminus1: Specifies the width of the current picture in unitsof macroblocks, minus 1. A derived term called PicWidthInMB is formed byadding one to PicWidthInMBminus1.

PicHeightInMBminus1: Specifies the width of the current picture in unitsof macroblocks, minus 1. A derived term called PicHeightInMB is formedby adding one to PicHeightInMBminus1.

ChromaFormat: Affects number of prediction error blocks expected by theAccelerator. This variable is defined in Section 6.3.5 and Table 6-5 ofH.262. For MPEG-1, MPEG-2 “Main Profile,” H.261 and H.263 bitstreams,this value shall always be set to ‘01’, indicating “4:2:0” format. If‘10’ this indicates “4:2:2”, and “11” indicates “4:4:4” sampling.Horizontal chroma siting differs slightly between H.261, H.263, MPEG-1versus MPEG-2 and MPEG-4. This difference may be small enough to ignore.

PicStructure: This parameter has the same meaning as thepicture_structure parameter defined in Section 6.3.10 and Table 6-14 ofMPEG-2, and indicates whether the current picture is a top-field picture(value ‘01’), a bottom-field picture (value ‘10’), or a frame picture(value ‘11’). In progressive-scan frame-structured coding such as inH.261, PicStructure shall be ‘11’.

RCONTROL: This flag is defined in H.263 Section 6.1.2. It defines therounding method to be used for half-sample motion compensation. A valueof 0 indicates the half-sample rounding method found in MPEG-1, MPEG-2,and the first version of H.263. A value of 1 indicates the roundingmethod which includes a downward averaging bias which can be selected insome optional modes of H.263 and MPEG-4. It is meaningless for H.261,since H.261 has no half-sample motion compensation. It shall be set to 0for all MPEG- 1, and M1PEG-2 bitstreams in order to conform with therounding operator defined by those standards.

BidirectionalAveragingMode: This flag indicates the rounding method forcombining prediction planes in bi-directional motion compensation (usedfor B pictures and Dual-Prime motion). The value 0 is MPEG-1 and MPEG-2rounded averaging (//2), and 1 is H.263 truncated averaging (/2). Thisshall be 0 if no bidirectional averaging is needed.

MVprecisionAndChromaRelation: This two-bit field indicates the precisionof luminance motion vectors and how chrominance motion vectors shall bederived from luminance motion vectors:

-   -   ‘00’ indicates that luminance motion vectors have half-sample        precision and that chrominance motion vectors are derived from        luminance motion vectors according to the rules in MPEG-2,    -   ‘01’ indicates that luminance motion vectors have half-sample        precision and that chrominance motion vectors are derived from        luminance motion vectors according to the rules in H.263,    -   ‘10’ indicates that luminance motion vectors have full-sample        precision and that chrominance motion vectors are derived from        luminance motion vectors according to the rules in H.261 Section        3.2.2 (dividing by two and truncating toward zero to full-sample        values), and    -   ‘11’ is reserved.

PicSpatialResid8: A value of 1 indicates that spatial-domain differenceblocks for host-based residual difference decoding can be sent using8-bit samples, and a value of 0 indicates that they cannot. Shall be 0if ConfigResidDiffHost is 0 or if BPP>8. Shall be 1 if BPP=8 andIntraPicture=1 and ConfigResidDiffHost is “1”. If 1, this indicates thatspatial-domain intra macroblocks are sent as signed 8-bit differencevalues relative to the constant value 2^(BPP-1) and that spatial-domainnon-intra macroblock differences are sent as signed 8-bit differencevalues relative to some motion compensated prediction. PicSpatialResid8differs from ConfigSpatialResid8 in that it is an indication for aparticular picture, not a global indication for the entire videosequence. In some cases such as in an intra picture with BPP equal to“8”, PicSpatialResid8 will be 1 even though ConfigSpatialResid8 may be0.

PicOverflowBlocks: A value of 1 indicates that spatial-domain differenceblocks for host-based residual difference decoding can be sent using“overflow” blocks, and a value of 0 indicates that they cannot. Shall be0 if ConfigResidDiffHost is 0 or if BPP>8. PicOverflowBlocks differsfrom ConfigOverflowBlocks in that it is an indication for a particularpicture, not a global indication for the entire video sequence. In somecases such as in an intra picture with BPP equal to “8”,PicOverflowBlocks will be 0 even though ConfigOverflowBlocks is “1”.

PicResid8Subtraction: A value of 1 when PicSpatialResid8 is 1 indicatesthat some 8-bit spatial-domain residual differences shall be subtractedrather than added, according to one aspect of the present invention.Shall be 0 if PicSpatialResid8 is 0 or ConfigResid8Subtraction is 0.According to one aspect of the present invention, ifPicResid8Subtraction is 1 and PicOverflowBlocks is 1, this indicatesthat the spatial-domain residual difference overflow blocks shall besubtracted rather than added. If PicResid8Subtraction is 1 andPicOverflowBlocks is 0, this indicates that no overflow blocks are sentand that all spatial-domain residual difference blocks shall besubtracted rather than added, and that no macroblocks will be sent asintra macroblocks. This ability to subtract differences rather than addthem allows 8-bit difference decoding to be fully compliant with thefull ±255 range of values required in video decoder specifications,since +255 cannot be represented as the addition of two signed 8-bitnumbers but any number in the range ±255 can be represented as thedifference between two signed 8-bit numbers (+255=+127 minus −128). Inthis regard, API 104 provides a flexible solution to host-based IDCT.

PieExtrapolation: This flag indicates whether motion vectors overpicture boundaries are allowed as specified by H.263 Annex D and MPEG-4.This requires either allocation of picture planes which are twomacroblocks wider (one extra macroblock at the left and another at theright) and two macroblocks taller (one extra macroblock at the top andanother at the bottom) than the decoded picture size, or clipping of theaddress of each individual pixel access to within the pictureboundaries. Macroblock addresses in this specification are formacroblocks in the interior of the picture, not including padding.

PicDeblocked: Indicates whether deblocking commands are sent for thispicture for creating a deblocked output picture in the picture bufferindicated in DeblockedPictureIndex. If PicDeblocked=1, deblockingcommands are sent and the deblocked frame shall be generated, and ifPicDeblocked=0, no deblocking commands are sent and no deblocked pictureshall be generated.

Pic4MVallowed: Specifies whether four forward-reference motion vectorsper macroblock are allowed as used in H.263 Annexes F and J.

PicOBMC: Specifies whether motion compensation for the current pictureoperates using overlapped block motion compensation (OBMC) as specifiedin H.263 Annex F. Shall be zero if Pic4Vallowed is 0.

PicBinPB: Specifies whether bi-directionally-predicted macroblocks inthe picture use “B in PB” motion compensation, which restricts thebi-directionally predicted area for each macroblock to the region of thecorresponding macroblock in the backward reference picture, as specifiedin Annexes G and M of H.263.

MV_RPS: Specifies use of motion vector reference picture selection. If1, this indicates that a reference picture index is sent for each motionvector rather than just forward and possibly backward motion pictureindexes for the picture as a whole. If MV_RPS is 1, the parametersForwardRefPictureIndex and BackwardRefPictureIndex have no meaning andshall be zero.

PicDeblockConfined: Indicates whether deblocking filter command bufferscontain commands which confine the effect of the deblocking filteroperations to within the same set of macroblocks as are contained in thebuffer.

PicReadbackRequests: Indicates whether read-back control requests areissued for the current picture to read back the values of macroblocks inthe final decoded picture. A value of 1 indicates that read-backrequests are present, and 0 indicates that they are not.

PicScanFixed: When using accelerator-based IDCT processing of residualdifference blocks, a value of 1 for this flag indicates that theinverse-scan method is the same for all macroblocks in the picture, anda value of 0 indicates that it is not. Shall be 1 ifConfigHostInverseScan is 1 or if ConfigResidDiffAccelerator is 0.

PicScanMethod: When PicScanFixed is 1, this field indicates the fixedinverse scan method for the picture. When PicScanFixed is 0, this fieldhas no meaning and shall be ‘00’. If PicScanFixed=1 this field shallhave one of the following values:

If ConfigHostInverseScan=0, PicScanMethod shall be as follows:

‘00’ = Zig-zag scan (H.262 FIG. 7-2), ‘01’ = Alternate-vertical (H.262FIG. 7-3), ‘10’ = Alternate-horizontal (H.263 FIG. I.2 Part a),

If ConfigHostInverseScan=1, PicScanMethod shall be as follows:

‘11’=Arbitrary scan with absolute coefficient address.

PicResampleOn: Specifies whether an input picture is to be resampled toa destination buffer prior to decoding the current picture or whetherthe final output picture is to be resampled for use as an upsampleddisplay picture or as a future upsampled or downsampled referencepicture. The resampling is performed as specified for H.263 Annex OSpatial Scalability or for H.263 Annex P, which we believe to be thesame as in some forms of the Spatial Scalability in MPEG-2 and MPEG-4.If this value is 1, the remaining resampling parameters are used tocontrol the resampling operation. If 0, the resampling is not performedand the remaining resampling parameters shall be zero. IfPicExtrapolation is 1 and the padding method is used on the accelerator,any resampling shall include padding of the resampled picture aswell—and this padding shall be at least one macroblock in width andheight around each edge of the resampled picture regardless of theresampling operation which is performed.

PicResampleBefore: Specifies whether the resampling process is to beapplied before (a value of 1) the processing of the current picture, orafter it (a value of 0). If resampling after decoding is indicated andDeblockedPictureIndex differs from DecodedPictureIndex, the decodedpicture (not the deblocked picture) is the one that has the resamplingapplied to it. If resampling after decoding is indicated and theDeblockedPictureIndex is the same as the DecodedPictureIndex, thedeblocking shall be applied to the decoded picture with the resultplaced in that same destination frame buffer—and the resampling processshall be performed using the deblocked frame buffer as the inputpicture.

PicResampleRcontrol: Specifies the averaging rounding mode of theresampling operation. In the case of H.263 Annex O Spatial Scalability,this parameter shall be 1. (This corresponds to the value of RCRPR inH.263 Annex P which is equivalent to the upsampling needed for H.263Annex O spatial scalability.) In the case of H.263 Annex P ReferencePicture Resampling, this parameter shall be equal to the H.263 parameterRCRPR.

PicResampleSourcePicIndex: Specifies the reference buffer to be isresampled in order to make it the same size as the current picture.

PicResampleDestPicIndex: Specifies the buffer to be used for the outputof the reference picture resampling operation. This buffer can then beused as a reference picture for decoding the current picture.

PicResampleSourceWidthMinus1: Specifies the width of the area of thesource picture to be resampled to the destination picture. A derivedparameter PicResampleSourceWidth is formed by adding one toPicResampleSourceWidth.

PicResampleSourceHeightMinus1: Specifies the height of the area of thesource picture to be resampled to the destination picture. A derivedparameter PicResampleSourceHeight is formed by adding one toPicResampleSourceHeight.

PicResampleDestWidthMinus1: Specifies the width of the area of thedestination picture to contain the resampled data from the sourcepicture. A derived parameter PicResampleDestWidth is formed by addingone to PicResampleDestWidth.

PicResampleDestHeightMinus1: Specifies the height of the area of thedestination picture to contain the resampled data from the sourcepicture. A derived parameter PicResampleDestHeight is formed by addingone to PicResampleSourceHeight.

PicResampleFullDestWidthMinus1: Specifies the full height of the area ofthe destination picture to contain the resampled data from the sourcepicture. Clipping shall be used to generate any samples outside thesource resampling area. (This parameter is necessary for H.263 Annex Psupport of custom source formats in which the luminance width is notdivisible by 16.) A derived parameter PicResampleFullDestWidth is formedby adding one to PicResampleFullDestWidth.

PicResampleFullDestHeightMinus1: Specifies the full height of the areaof the destination picture to contain the resampled data from the sourcepicture. Clipping shall be used to generate any samples outside thesource resampling area. (This parameter is necessary for H.263 Annex Psupport of custom source formats in which the luminance height is notdivisible by 16.) A derived parameter PicResampleFullDestWidth is formedby adding one to PicResampleFullDestHeight.

Buffer Structure for Macroblocks of a Picture

As introduced above, the second type of operational data structure(s)204 define the buffer structure for macroblocks of a picture. Accordingto one aspect of the present invention, five (5) types of macroblockbuffers are defined herein including, for example, (1) macroblockcontrol command buffers; (2) residual difference block data buffers; (3)deblocking filter control command buffers with or without a restrictionon the effect of the filter; (4) read-back buffers containing commandsto read macroblocks of the resulting (decoded) picture back into thehost; and (5) bitstream buffers. In accordance with one embodiment,another (i.e., sixth) buffer is provided within the operational datastructure(s) 204 for DVD subpicture control.

Except for the bitstream buffer(s) and the DVD subpicture buffer(s),each of the foregoing contains commands for a set of macroblocks,wherein the beginning of each buffer contains one or more of (1) thetype of data within the buffer as enumerated in the list above (8 bits),(2) the macroblock address of the first macroblock in the buffer (16bits), (3) the total fullness of the buffer in bytes (32 bits), (4) thenumber of macroblocks in the buffer (16 bits), and/or (5) reserved bitpadding to the next 32 Byte boundary. A decoded picture shall containone or more macroblock control command buffer(s) if it does not containbitstream data buffers. The decoding process for every macroblock shallbe addressed (only once) in some buffer of each type that is used. Forevery macroblock control command buffer, there shall be a correspondingIDCT residual coding buffer containing the same set of macroblocks(illustrated, with reference to FIGS. 3 and 4). If one or moredeblocking filter control buffers are sent, the set of macroblocks ineach deblocking filter control buffer shall be the same as the set ofmacroblocks in the corresponding macroblock control and residual codingbuffers.

The processing of the picture requires that motion prediction for eachmacroblock must precede the addition of the IDCT residual data.According to one implementation of the present invention, this isaccomplished either by processing the motion prediction commands firstand then reading this data back in from the destination picture bufferwhile processing the IDCT residual coding commands, or by processingthese two buffers in a coordinated fashion, i.e., adding the residualdata to the prediction before writing the result to the destinationpicture buffer. The motion prediction command and IDCT residual codingcommand for each macroblock affect only the rectangular region withinthat macroblock.

A deblocking filter command for a macroblock may require access to readthe reconstructed values of two rows and two columns of samplesneighboring the current macroblock at the top and left as well asreconstructed values within the current macroblock. It can result inmodification of one row and one column of samples neighboring thecurrent macroblock at the top and left as well as three rows and threecolumns within the current macroblock. The filtering process for a givenmacroblock may therefore require the prior reconstruction of othermacroblocks. Two different types of deblocking filter buffers aredefined herein: (1) a buffer type which requires access and modificationof the value of reconstructed samples for macroblocks outside thecurrent buffer (e.g., when PicDeblockConfined is set to ‘0’), and (2) abuffer type which does not (e.g., when PicDeblockConfined is set to‘1’). To process the first of these two types of deblocking commandbuffer, the accelerator must ensure that the reconstruction has beencompleted for all buffers which affect macroblocks to the left and topof the macroblocks in the current buffer before processing thedeblocking commands in the current buffer. Processing the second ofthese two types requires only prior reconstruction values within thecurrent buffer. The deblocking post-processing can be conducted eitherby processing the motion prediction and IDCT residual coding commandsfor the entire buffer or frame first, followed by reading back in thevalues of some of the samples and modifying them as a result of thedeblocking filter operations, or by processing the deblocking commandbuffer in a coordinated fashion with the IDCT residual codingbuffer—performing the deblocking before writing the final output valuesto the destination picture buffer. Note also that the destinationpicture buffer for the deblocked picture may differ from that of thereconstructed picture prior to deblocking, in order to support “outsidethe loop” deblocking as a post-processing operation which does notaffect the sample values used for prediction of the next picture.

Table IV, below, provides example macroblock control commands,selectively invoked by API 104 in operational data structure(s) 204 inresponse to a negotiated decoding format and media processing taskallocation among and between media processing system elements.

TABLE IV Example Control Commands if (IntraPicture) NumMV = 0; elseif(PicOBMC) { NumMV = 10; if(PicBinPB) NumMV++; }else{ NumMV = 4;if(PicBinPB && Pic4MVallowed) NumMV++; } if(ChromaFormat == ‘01’)NumBlocksPerMB = 6 else if(ChromaFormat == ‘10’) NumBlocksPerMB = 8 elseNumBlocksPerMB = 12 MB_Control { // General Macroblock Info MBaddressMBtype MBskipsFollowing // Residual Difference Info MBdataLocationPatternCode if(PicOverflowBlocks==1 && IntraMacroblock==0) { PC_OverflowReservedBits2 } else if(HostResidDiff) ReservedBits3 else for(i=0;i<NumBlocksPerMB; i++) NumCoef[i] // Motion Prediction Info for(i=0;i<NumMV; i++) { MVector[i].horz MVector[i].vert } if(MV_RPS) for(i=0;i<NumMV; i++) RefPicSelect[i] ReservedBits4 }

Each of the various control command attributes are described, in turn,below.

MBaddress: Specifies the macroblock address of the current macroblock inraster scan order (0 being the address of the top left macroblock,PicWidthInMBminus 1 being the address of the top right macroblock, andPicHeightInMBminus 1 * PicWidthInMB being the address of the bottom leftmacroblock, and PicHeightInMBminus1 * PicWidthInMB+PicWidthInMBminus1being the address of the bottom right macroblock).

MBtype: Specifies the type of macroblock being processed as describedbelow:

-   -   bit 15: MvertFieldSel[3] (The MSB),    -   bit 14: MvertFieldSel[2],    -   bit 13: MvertFieldSel[1],    -   bit 12: MvertFieldSel[0]: Specifies vertical field selection for        corresponding motion vectors sent later in the macroblock        control command, as specified in further detail below. For        frame-based motion with a frame picture structure (e.g., for        H.261 and H.263), these bits shall all be zero. The use of these        bits is the same as that specified for the corresponding bits in        Section 6.3.17.2 of H.262.    -   bit 11: ReservedBits.    -   bit 10: HostResidDiff: Specifies whether spatial-domain residual        difference decoded blocks are sent or whether transform        coefficients are sent for off-host IDCT for the current        macroblock.    -   bits 9 and 8: MotionType: Specifies the motion type in the        picture, as specified in further detail below. For frame-based        motion with a frame picture structure (e.g., for H.261 and        H.263), these bits shall be equal to ‘10’. The use of these bits        is the same as that specified for the corresponding bits in        Section 6.3.17.1 and Table 6-17 of H.262.    -   bits 7 and 6: MBscanMethod: Shall equal PicScanMethod if        PicScanFixed is 1.

If ConfigHostInverseScan=0, MBscanMethod shall be as follows:

‘00’ = Zig-zag scan (H.262 FIG. 7-2), ‘01’ = Alternate-vertical (H.262FIG. 7-3), ‘10’ = Alternate-horizontal (H.263 FIG. I.2 Part a),

If ConfigHostInverseScan=1, MBscanMethod shall be equal to:

‘11’=Arbitrary scan with absolute coefficient address.

-   -   bit 5: FieldResidual: A flag indicating whether the IDCT blocks        use a field IDCT structure as specified in H.262.    -   bit 4: H261LoopFilter: A flag specifying whether the H.261 loop        filter (Section 3.2.3 of H.261) is active for the current        macroblock prediction. The H.261 loop filter is a separable ¼,        ½, ¼ filter applied both horizontally and vertically to all six        blocks in an H.261 macroblock except at block edges where one of        the taps would fall outside the block. In such cases the filter        is changed to have coefficients 0, 1, 0. Full arithmetic        precision is retained with rounding to 8-bit integers at the        output of the 2-D filter process (half-integer or higher values        being rounded up).    -   bit 3: Motion4MV: A flag indicating that forward motion uses a        distinct motion vector for each of the four luminance blocks in        the macroblock, as used in H.263 Annexes F and J. Motion4MV        shall be 0 if MotionForward is C or Pic4MVallowed is 0.    -   bit 2: MotionBackward: A flag used as specified for the        corresponding parameter in H.262. Further information on the use        of this flag is given below.    -   bit 1: MotionForward: A flag used as specified for the        corresponding flag in H.262. Further information on the use of        this flag is given below.    -   bit 0: IntraMacroblock: (The LSB) A flag indicating that the        macroblock is coded as “intra”, and no motion vectors are used        for the current macroblock. Further information on the use of        this flag is given below.

MBskipsFollowing: Specifies the number of “skipped macroblocks” to begenerated following the current macroblock. Skipped macroblocks shall begenerated using the rules specified in H.262 Section 7.6.6. According toone implementation, the API 104 operates by using an indication of thenumber of skipped macroblocks after the current macroblock instead ofthe number of skipped macroblocks before the current macroblock. Insofaras the method of generating skipped macroblocks as specified in H.262Section 7.6.6 depends on the parameters of the macroblock preceding theskipped macroblocks, specifying the operation in this way means thatonly the content of a single macroblock control structure need beaccessed for the generation of the skipped macroblocks.

For implementation of standard video codecs other than H.262 (MPEG-2),some “skipped” macroblocks may need to be generated with some indicationother than the skipped macroblock handling used by MBskipsFollowing ifthe skipped macroblock handling differs from that of H.262.

The generation of macroblocks indicated as skipped in H.263 withAdvanced Prediction mode active requires coding some “skipped”macroblocks as non-skipped macroblocks using this specification—in orderto specify the OBMC effect within these macroblocks.

MBdataLocation: An index into the IDCT residual coding block databuffer, indicating the location of the residual difference data for theblocks of the current macroblock, expressed as a multiple of 32 bits.

PatternCode: When using host-based residual difference decoding, bit 11-i of wPatternCode (where bit 0 is the LSB) indicates whether a residualdifference block is sent for block i, where i is the index of the blockwithin the macroblock as specified in FIGS. 6-10, 6-11, and 6-12(raster-scan order for Y, followed by 4:2:0 blocks of Cb in raster-scanorder, followed by 4:2:0 blocks of Cr, followed by 4:2:2 blocks of Cb,followed by 4:2:2 blocks of Cr, followed by 4:4:4 blocks of Cb, followedby 4:4:4 blocks of Cr). The data for the coded blocks (those blockshaving bit 11-i equal to 1) is found in the residual coding buffer inthe same indexing order (increasing i). For 4:2:0 H.262 data, the valueof wPatternCode corresponds to shifting the decoded value of CBP left bysix bit positions (those lower bit positions being for the use of 4:2:2and 4:4:4 chroma formats).

If ConfigSpatialResidInterleaved is “1”, host-based residual differencesare sent in a chroma-interleaved form matching that of the YUV pixelformat in use. In this case each Cb and spatially-corresponding Cr pairof blocks is treated as a single residual difference data structureunit. This does not alter the value or meaning of PatternCode, but itimplies that both members of each pair of Cb and Cr data blocks are sentwhenever either of these data blocks has the corresponding bit set inPatternCode. If the bit in PatternCode for a particular data block iszero, the corresponding residual difference data values shall be sent aszero whenever this pairing necessitates sending a residual differencedata block for a block with a PatternCode bit equal to zero.

PC_Overflow: When using host-based residual difference decoding withPicOverflowBlocks (the innovative 8-8 overflow method introduced above,and described in greater detail below), PC_Overflow contains the patterncode of the overflow blocks as specified in the same manner as forPatternCode. The data for the coded overflow blocks (those blocks havingbit 11-i equal to 1) is found in the residual coding buffer in the sameindexing order (increasing i).

NumCoef[i]: Indicates the number of coefficients in the residual codingblock data buffer for each block i of the macroblock, where i is theindex of the block within the macroblock as specified in H.262 FIGS.6-10, 6-11, and 6-12 (raster-scan order for Y, followed by 4:2:0 blocksof Cb in raster-scan order, followed by 4:2:0 blocks of Cr, followed by4:2:2 blocks of Cb, followed by 4:2:2 blocks of Cr, followed by 4:4:4blocks of Cb, followed by 4:4:4 blocks of Cr). The data for thesecoefficients is found in the residual difference buffer in the sameorder.

MVector[i].horz, MVector[i].vert: Specifies the value of a motion vectorin horizontal and vertical dimensions. The two-dimensional union ofthese two values is referred to as MVvalue[i]. Each dimension of eachmotion vector contains a signed integer motion offset in half-sampleunits. Both elements shall be even if MVprecisionAndChromaRelation=‘10’(H.261-style motion supporting only integer-sample offsets).

RefPicSelect[i]: Specifies the reference picture buffer used inprediction for MVvalue[i] when motion vector reference picture selectionis in use.

IDCT Support

According to one aspect of the present invention, API 104 supports atleast three (3) low-level methods of handling inverse discrete cosinetransform (IDCT) decoding via the operational data structure(s) 204. Inall cases, the basic inverse quantization process, pre-IDCT rangesaturation, and mismatch control (if necessary) is performed by thedecoder 160 (e.g., on the host), while the final picture reconstructionand reconstruction clipping is done on the accelerator 174. The firstmethod is to pass macroblocks of transform coefficients to theaccelerator 174 for external IDCT, picture reconstruction, andreconstruction clipping. The second and third methods involve performingan IDCT by the decoder 160 and passing blocks of spatial-domain resultsfor external picture reconstruction and clipping on the accelerator 174.

According to one implementation (also denoted with reference to FIG. 6),the pre-IDCT saturation, mismatch control, IDCT, picture reconstructionand clipping processes are defined as:

-   -   (1) Saturating each reconstructed coefficient value in the        transform coefficient block to the allowable range (typically        performed by the decoder 160):        −2^(BPP+log) ² ^(√){square root over (W ^(T) ^(H) ^(T)        )}≦F′(u,v)≦2^(BPP+log) ² ^(√){square root over (W ^(T) ^(H) ^(T)        )}−1  (1)    -   (2) Mismatch control (as necessary in association with MPEG-2        decoding) is performed by adding the saturated values of all        coefficients in the macroblock. According to one implementation,        this is performed by XORing the least significant bits. If the        sum is even, then the saturated value of the last coefficient        F′(W_(T)−1,H_(T)−1) is modified by subtracting one if it is odd,        or adding one if it is even. The coefficient values subsequent        to saturation and mismatch control are denoted herein as F(u,v).    -   (3) Unitary separable transformation is performed (either on the        host or the accelerator, as negotiated):

${f( {x,y} )} = {\frac{1}{\sqrt{H_{T}}}{\sum\limits_{v = 0}^{H_{T}^{- 1}}{{C(v)}{\cos\lbrack \frac{( {{2y} + 1} )v\;\pi}{2H_{T}} \rbrack}\{ {\frac{1}{\sqrt{W_{r}}}{\sum\limits_{u = 0}^{W_{T}^{- 1}}{{C(u)}{\cos\lbrack \frac{( {{2x} + 1} )u\;\pi}{2W_{T}} \rbrack}{F( {u,v} )}}}} \}}}}$

-   -   where: C(u)=1 for u=0, otherwise the square root of 2 (√2);        -   C(v)=1 for v=0, otherwise √2;        -   x and y are the horizontal and vertical spatial coordinates            in the pixel domain; and        -   W_(T) and H_(T) are the width and height of the transform            block.    -   (4) Adding the spatial-domain residual information to the        prediction for non-intra macroblocks to perform picture        reconstruction (on the accelerator 174).    -   (5) Clipping the picture reconstruction to a range of        [0,2^(BPP)−1] to store as the final resulting picture sample        values (on the accelerator 174).

Host v. Accelerator IDCT

As alluded to above, API 104 provides for off-host (e.g.,accelerator-based) and host-based IDCT processing of multimedia content(described more fully below with FIG. 7). The transfer of macroblockIDCT coefficient data for off-host IDCT processing consists of a bufferof index and value information. According to one implementation, indexinformation is sent as 16-bit words (although, only 6-bit quantities arereally necessary for 8×8 transform blocks), and transform coefficientvalue information is sent as signed 16-bit words (although only 12-bitsare really needed). According to one implementation, the transformcoefficient is sent as a Tcoeff data structure as follows:

Tcoeff { TCoefIDX (specifies the index of the coefficient in the block)TCoefEOB (denotes last coefficient in block) TcoefValue (the value ofthe coefficient in the block) }

TCoefIDX: specifies the index of the coefficient in the block, asdetermined from ConfigHostInverseScan. There are two basic ways thatTCoefIDX can be used:

-   -   Run-length ordering: When ConfigHostInverseScan is 0,        MBscanMethod indicates a zig-zag, alternate-vertical, or        alternate-horizontal inverse scan. In this case, TCoefIDX        contains the number of zero-valued coefficients which precede        the current coefficient in the specified scan order, subsequent        to the last transmitted coefficient for the block (or the DC        coefficient if no preceding).    -   Arbitrary ordering: When ConfigHostInverseScan is 1,        MBscanMethod indicates arbitrary ordering. In this case,        TCoefIDX simply contains the raster index of the coefficient        within the block (i.e., TCoefIDX=u+v·W_(T))    -   TCoefIDX shall never be greater than or equal to W_(T)·H_(T).

TCoefEOB: Indicates whether the current coefficient is the last oneassociated with the current block of coefficients. A value of 1 isindicates that the current coefficient is the last one for the block,and a value of 0 indicates that it is not.

TCoefValue: The value of the coefficient in the block. TCoefValue shallbe clipped to the appropriate range as specified in Section 3.4.2 aboveby the host prior to passing the coefficient value to the acceleratorfor inverse DCT operation. H.262 mismatch control, if necessary, is alsothe responsibility of the host, not the accelerator.

Alternatively, API 104 also supports host-based IDCT (e.g., by thedecoder 160), with the result passed through API 104 to accelerator 174.In accordance with the teachings of the present invention, there are twosupported schemes for sending the results: (1) the 16-bit method and the(2) 8-8 overflow method. An indication of which is being used is sentvia the hostIDCT_(—)8or _(—)16bit command in the operational datastructure(s) 204.

When sending data using the 16-bit method, blocks of data are sentsequentially. Each block of spatial-domain data consists of W_(T)·H_(T)values of DXVA_Sample16 which, according to one embodiment, is a 16-bitsigned integer. If BPP is greater than 8, only the 16 bit method isallowed. If IntraPicture=‘1’ and BPP is 8, the 16-bit method is notallowed. For intra data, the samples are sent as signed quantitiesrelative to a reference value of 2^(BPP−1).

According to one aspect of the present invention, API 104 supports analternative to the 16-bit method, i.e., the 8 bit difference method. IfBPP=8, the 8-bit difference method may well be used. As alluded toabove, its use is required if IntraPicture is ‘1’ and BPP=8. In thiscase, each spatial-domain difference value is represented using only 8bits. If IntraMacroblock is ‘1’, the 8-bit samples are signeddifferences to be added relative to 2^(BPP−1), whereas ifIntraMacroblock is ‘0’ they are signed differences to be added orsubtracted (as denoted by PicResid8Subtraction) relative to a motioncompensation prediction. If IntraMacroblock is ‘0’ and the difference tobe represented for some pixel in a block is too large to represent usingonly 8 bits, a second “overflow” block of samples can be sent ifConfigOverflowBlocks is ‘1’. In this case, blocks of data are sentsequentially, in the order specified by scanning PatternCode for ‘1’bits from most-significant-bit (MSB) to least-significant-bit (LSB), andthen all necessary 8-bit overflow blocks are sent as specified byPC_Overflow. Such overflow blocks are subtracted rather than added ifPicResid8Subtraction is ‘1’. If ConfigOverflowBlocks is ‘0’, then anyoverflow blocks can only be sent in a completely separate pass as adistinct picture. Each block of 8-bit spatial-domain residual differencedata consists of W_(T)·H_(T) values of DXVA_Sample8 (an eight bit signedinteger).

If PicResid8Subtraction is ‘1’ and PicOverflowBlocks is ‘0’,IntraMacroblock shall be ‘0’. If PicOverflowBlocks is ‘1’ andPicResid8Subtraction is a ‘1’, the first pass of 8-bit differences foreach non-intra macroblock is added and the second pass is subtracted. IfPicOverflowBlocks is ‘1’ and PicResid8Subtraction is ‘0’, both the firstpass and the second pass of 8-bit differences for each non-intramacroblock are added. If PicResid8Subtraction is ‘0’ andPicOverflowBlocks is ‘0’, the single pass of 8-bit differences is added.If PicResid8Subtraction is ‘1’ and PicOverflowBlocks is ‘0’, the singlepass of 8-bit differences is subtracted.

Read-back Buffers

According to one implementation, API 104 utilizes one read-back bufferin operational data structure(s) 204 when PicReadbackRequests=‘1’, whichcommands the accelerator 174 to return resulting final picturemacroblock to decoder 160 on the host (e.g., after any deblocking andsubpicture sampling, yet prior to any output resampling). The bufferpassed to the accelerator shall contain read-back commands containing asingle parameter per macroblock read:

MBaddress: Specifies the macroblock address of the current macroblock inraster scan order. If BPP is 8, the data shall be returned in the formof 8-bit signed values, otherwise in the form of 16-bit signed values(relative to 2^(BPP−1)).

The data is returned to the decoder 160 in the form of (1) a copy of theread-back command buffer itself followed by padding to the next 32-bytealignment boundary; and (2) the macroblock data values. The macroblockdata values are returned in the order sent in the read-back commandbuffer, in the form W_(T)·H_(T) samples per block for each block in eachmacroblock. Residual difference blocks within a macroblock shall bereturned in raster-scan order for Y, followed by all 4:2:0 blocks of Cbin raster scan order, followed by 4:2:0 blocks of Cr, followed by 4:2:2blocks of Cb, and so on.

Bitstream Data Buffer

API 104 also supports a bitstream data buffer within operational datastructure(s) 204. As used herein, the bitstream data buffer, if used,primarily contains raw bytes from a video bitstream to support off-host(e.g., accelerator 174) decoding including low-level bitstream parsingwith variable length decoding. According to one example implementation,the beginning of such a buffer contains one or more of (1) the number‘5’ encoded in 8-bits to denote the bitstream buffer, (2) the sequencenumber of the buffer within the picture, starting with the first suchbuffer being buffer zero (0), (3) the total size of the buffer in bytes,(4) if the sequence number is zero, the relative location within thebitstream data of the first bit after the picture header data, i.e., thefirst bit of the group of blocks (GOB) or slice, or macroblock layerdata, and (5) reserved bit padding to the next 32 byte boundary.

The remaining contents of the buffer are the raw bytes of a videobitstream encoded according to a specified video coding format. Thebuffer with sequence number zero start with the first byte of the datafor the picture and the bytes thereafter follow in bitstream order.

DVD Subpicture Control Buffer

As introduced above, operational data structure(s) 204 may also includea subpicture control buffer to support digital versatile disc (or DVD)applications. API 104 is invoked in support of such an application, thecontent of the subpicture control buffer within the operational datastructure(s) 204 includes one or more of the following:

SubpictureBufferIndicator ReservedBits BufferSize BlendType ButtonColorButtonTopLeftHorz ButtonTopLeftVert ButtonBotRightHorzButtonBotRightVert ButtonHighlightActive PaletteIndicator PaletteDataNewSubpictureUnitSize DCSQTStartAddress SubpictureUnitData

SubpictureBufferIndicator: The number “6”, indicating a DVD subpicturebuffer.

BufferSize: The total number of bytes in the buffer.

BlendType: A value of “0” indicates that no subpicture blending isactive for the current picture. A value of “1” indicates that the lastpreviously-sent subpicture data is used for blending the currentpicture, and a value of “2” indicates that a new subpicture sent in thecurrent buffer is used for blending the current picture.

ButtonColor: Contains the color of a rectangular button on thesubpicture.

ButtonTopLeftHorz, ButtonTopLeftVert, ButtonBotRightHorz,

ButtonBotRightHorz: Contains the zero-based 2-d location of the top leftand bottom right coordinates of the button.

ButtonHighlightActive: Indicates whether or not the button is currentlyhighlighted.

PaletteIndicator: Indicates whether or not a new palette is contained inthe buffer.

PaletteData: If PaletteIndicator is “1”, contains the new palette.Otherwise not present.

NewSubpictureUnitSize: The size of a new subpicture unit contained inthe buffer. If “0”, indicates that no new subpicture unit is containedin the buffer.

DCSQTStartAddress: The byte location within the SubpictureUnitData atwhich the subpicture display control sequence is found.

SubpictureUnitData: The subpicture PXD and SP_DCSQT data for the newsubpicture unit.

According to one aspect of the present invention, the control commanddata structure and the residual difference data structure of theoperational data structure(s) 204 are a fixed size for each macroblockwithin a picture based, at least in part, on one or more of thenegotiated coding format, the API configuration and the picture type.That is, API 104 utilizes fixed-size data structures to facilitatecommunication between any video decoder 160 and any video accelerator174 according to any codec. Example data control command and residualdifference data structures are provided with reference to FIGS. 3 and 4,respectively.

Example Data Structures

FIGS. 3 and 4 graphically illustrate an example control command datastructure 300 and a residual difference data structure 400 for aplurality of elements of received multimedia content. For purposes ofillustration, and not limitation, the data structures are presented inaccordance with the video decoding embodiment used throughout, whereinthe data structures are incrementally populated with video informationon a macroblock basis. According to one aspect of the present invention,introduced above, each of the control command data structures are offixed size for each macroblock within a picture.

As shown, each element within the control command data structure 300includes an address field 302, a pointer to an associated residualdifference data structure element 304, and a command field 306. Theaddress field 302 denotes which macroblock of a the frame the datastructure element is associated with. Use of the macroblock addressfield 302 facilitates parallel processing of the multimedia content.

The residual difference pointer field 304 contains pointers toassociated elements in the residual difference data structure 400. It isto be appreciated that not every macroblock will have residualdifference data, and the amount of residual data may vary frommacroblock to macroblock. Thus, use of the pointer field 304 relievesAPI 104 from having to inferentially associate each element of controlcommand data structure 300 with an element of residual difference datastructure 400.

The macroblock control command field 306 contains one or more commandsinstructing the decoder on what action to take with respect to theparticular macroblock. In general, the control command field 306contains information regarding encryption of the data sent betweendecoder 160 and accelerator 174, picture-level parameters, processingand communication control parameters.

In addition, as introduced above, decoder 160 may well provideaccelerator 174 with raw bitstream data, e.g., on a per-slice basis. Insuch an instance, API 104 generates a bitstream buffer to pass the rawbitstream data to the accelerator. According to one implementation,analogous to the control command data structure/residual difference datastructure combination, the raw bitstream data buffer is associated witha slice control data structure, to pass slice control information fromthe decoder to the accelerator.

Example Operation and Implementations

As introduced above, API 104 is an enabling technology in that itfacilitates communication between a decoder application 160 and ahardware accelerator 174 as to the specific decoder/acceleratorcombination to be used. Having introduced the architectural detail ofAPI 104, above, attention is now directed to FIGS. 5-8 wherein anexample implementation is described.

FIG. 5 is a flow chart of an example method for interfacing a decoderapplication with a hardware accelerator to cooperatively decode encodedmultimedia content, in accordance with the teachings of the presentinvention. For ease of explanation, and not limitation, the method ofFIG. 5 will be developed with continued reference to FIGS. 1-4.

Turning to FIG. 5, the method begins with block 502 which represents astep of iteratively issuing configuration commands reflecting variousalternative degrees and methods of decoding acceleration capabilityuntil choosing one that is acceptable to both the decoder and theaccelerator. Specifically, a media processing system element issues aConfigInfo data structure to other media processing system elements, asthe auto-negotiation process of API 104 is selectively invoked.According to one example embodiment, the auto-negotiation datastructure(s) 202 of API 104 are generated by decoder 160 and reflect aproposed decoding format (ConnectMode), intermediate data format andother decoding details (ConnectConfig).

In block 504, the issuing media processing element (e.g., decoder 160)receives a response to the issued auto-negotiation data structure(s) 202denoting whether the media processing element(s) (e.g., accelerator 174)supports the proposed media processing format defined in theauto-negotiation data structure(s) 202. If, in block 504, the proposedmedia processing format is not supported by one or more of the mediaprocessing elements (e.g., accelerator(s) 174), the issuing mediaprocessing element generates a new auto-negotiation data structure(s)202 reflecting an alternate media processing configuration, block 506.In particular, decoder 160 moves to another supported media processingformat and generates a ConnectMode and ConnectConfig commands reflectingthe proposed media processing format. According to one implementation,decoder 160 initiates the auto-negotiation process by proposing decodingin accordance with the MPEG-2 format.

If, in block 504, the media processing format is accepted, API 104dynamically selects one or more operational data structure(s) 204appropriate to facilitate media processing among and between the mediaprocessing elements in accordance with the negotiated format, block 508.In particular, API 104 selects picture parameters and buffer structuresappropriate to facilitate the particular media processing format agreedupon by the media processing elements (e.g., the decoder 160 andaccelerator 174).

In block 510, API 104 facilitates multimedia decoding among and betweenthe media processing elements utilizing the dynamically selectedoperational data structure(s) 204 until the media processing has beencompleted. Thus, API 104 identifies the media processing capability ofthe various media processing system elements, and facilitates decodingamong and between these elements without a priori knowledge of theparticular elements used. In this regard, API 104 is a ubiquitousmultimedia API insofar as it facilitates communication between anydecoder application and any multimedia accelerator.

FIG. 6 is a flow chart of an example method of decoding media content,according to one example implementation of the present invention. Inaccordance with the illustrated example implementation of FIG. 6, themethod begins once the decoding format has been negotiated between themedia processing system elements, e.g., decoder(s) 160, accelerator(s)174, etc. (block 504). The decoding process of FIG. 6 begins with block602 by saturating each reconstructed coefficient value in the transformcoefficient block to an allowable range. As introduced above, this iscommonly performed by the decoder application 160. Once the saturationis complete, the saturated values are added to the coefficients in themacroblock to perform mismatch control, as necessary, block 604. Asalluded to above, mismatch control may be necessary in MPEG-2 decoding.

In block 606, unitary separable transformation is performed. Thistransformation may well be performed by the decoder application 160 onthe host, or by the accelerator 174. According to one innovative aspectof API 104, a determination is made during the auto-negotiation processas to which element will perform the transformation.

In block 608, the spatial domain residual difference information isadded to the prediction for non-intra macroblocks to perform picturereconstruction. This task is typically performed off-host, i.e., at theaccelerator(s) 174.

In block 610, the accelerator 174 performs a clipping operation to clipthe picture reconstruction to an appropriate range to store as the finalresulting picture sample values.

FIG. 7 is a flow chart of an example method facilitating host-basedinverse discrete cosine transform (IDCT), according to one aspect of thepresent invention. In accordance with the illustrated example embodimentof FIG. 7, the method is begins with block 702 a determination is madeas to whether the IDCT process will be performed on the host (e.g., bydecoder 160), or on the accelerator 174. If the IDCT is performed by theaccelerator, a buffer structure is established in operational datastructure(s) 204 of API 104 to transfer macroblock IDCT coefficient datato the accelerator on a per-macroblock basis in support of thetransform, block 704. This process is continued until all of themacroblocks have been processed.

If the IDCT is to be performed on the host, a first determination ismade whether the BPP value is greater than 8 bits, block 706. If so, thespatial domain data resulting from the IDCT process performed by thedecoder 160 will be transferred to the accelerator 174 for furtherprocessing (i.e., reconstruction, clipping, etc.) as 16-bit signedintegers, block 708.

If, in block 706, BPP is not greater than 8-bits, a furtherdetermination is made whether the current picture is an intra-picture,block 710. If so, the spatial domain data will be represented as 8-bitsigned integers, block 712. In block 714, based on one or moreoperational data structure(s) 204 parameters, one or more 8-bit blocksof data are sent for each macroblock and added or subtracted torepresent the spatial domain data. More specifically, as introducedabove, API 104 facilitates an innovative means of transferring spatialdomain data in 8-bit increments using the 8-bit difference method. Thedetermination of whether one or two blocks is required, and whether theblocks are to be added or subtracted depends on thePicResid8Subtraction, PicOverflowBlocks, PC_Overflow and IntraMacroblocksettings of operational data structure(s) 204. A table summarizing thesettings and result is provided, below.

Effect of 8-bit Spatial Differences Overflow Pass First Effect (Not PassAllowed PicOverflowBlocks PicResid8Subtraction Effect if Intra) 0 0added N/A 0 1 subtracted N/A (no intra 1 0 added added 1 1 addedsubtractedDeblocking Filter Control

Turning to FIG. 8, API 104 facilitates control of a deblocking filter onan accelerator 174 by the decoder 160, according to one aspect of thepresent invention. In accordance with the illustrated exampleimplementation, API 104 assesses received commands for deblocking filtercontrol commands, block 802. If deblocking filter control commands arerecognized within a command received from decoder 160, API 104 generatesoperational data structure(s) 204 including instructions which, whenreceived by the accelerator 174, will affect one or more deblockingfilter settings, block 804. In block 806, deblocking filter controlcommands if present within operational data structure(s) 204, are sentfor each luminance block in a macroblock and are sent once for each pairof chrominance blocks. According to one implementation, the commands aresent in raster scan order within the macroblock, with all blocks forluminance sent before any blocks for chrominance, then one chrominance4:2:0 command, then one chrominance 4:2:2 command if needed, then twochrominance 4:4:4 commands if needed (the same filtering is applied toboth chrominance components). According to one implementation, thefiltering for each block is specified by specification of the deblockingto occur across its top edge, followed by specification of thedeblocking to occur across its left edge. Deblocking is specified forchrominance only once—and the same deblocking commands are used for boththe Cb and Cr components. For example, deblocking of a 16×16 macroblockwhich contains 4:2:0 data using 8×8 blocks is specified by sending four(4) sets of two (one top and one left) edge filtering commands for theluminance blocks, followed by one set of two edge filtering commands forthe chrominance. In response, to receiving such a data structure,accelerator 174 modifies zero or more deblocking filter attributes, inaccordance with the received deblocking filter commands, block 808. Anexample data structure to effect deblocking filter commands withinoperational data structure 204 is provided as:

deblocking_edge_control { DXVA_filterOn STRENGTH }

DXVA_filterOn: This flag shall be ‘1’ if the edge is to be filtered;

STRENGTH: This parameter specifies the strength of the filtering to beperformed. According to one implementation, the strength values areadopted from H.263 Annex J.

Alternate Implementations

FIG. 9 illustrates a block diagram of a media application programinterface (API) according to an alternate embodiment of the presentinvention. According to the illustrated example embodiment of FIG. 9, inaddition to auto-negotiation data structure(s) 202 and operational datastructure(s) 204, API 900 includes control logic 902, memory resources904 and input/output (I/O) interface facilities 906, each coupled asshown. According to this alternate embodiment, control logic 902dynamically generate auto-negotiation data structure(s) 202, which aresent to one or more media processing elements via I/O interface 906 tonegotiate the media processing capability of one or more mediaprocessing elements of a media processing system. According to oneimplementation, a number of media processing formats are retained inmemory 904 for use in generating the auto-negotiation data structure(s)202. In one implementation, control logic 902 accesses communicativelycoupled resources for media processing formats with which to generateauto-negotiation data structure(s) 202. Control logic 902 iterativelyissues auto-negotiation data structure(s) 202 until the elements of themedia processing system have agreed upon a media processing format anddivision of media processing responsibility.

Once a processing format has been agreed upon, control logic 902 selectsone or more operational data structure(s) 204 to facilitate furthermedia processing among and between media processing elements, inaccordance with the agreed upon format.

Turning next to FIG. 10, a block diagram of a storage medium havingstored thereon a plurality of instructions including instructions which,when executed, implement the teachings of the present invention,according to yet another embodiment of the present invention. Ingeneral, FIG. 10 illustrates a storage medium/device 1000 having storedthereon a plurality of executable instructions 1002 including at least asubset of which that, when executed, implement the adaptive API 104 ofthe present invention. When executed by a processor (132) of a hostsystem (100), the executable instructions implementing API 104 identifyand characterize the processing capability of a multimedia processingsystem, and dynamically adjusts one or more operational settings tooperatively interface any decoder application with any multimediaaccelerator. In this regard, API 104 is an extensible, universalmultimedia API. According to one implementation, API 104 selectivelymodifies one or more operational settings to improve multimediaprocessing performance of the host system (100) based, at least in part,on the identified functional capability of the one or more elements ofthe multimedia processing system.

As used herein, storage medium 1000 is intended to represent any of anumber of storage devices and/or storage media known to those skilled inthe art such as, for example, volatile memory devices, non-volatilememory devices, magnetic storage media, optical storage media, and thelike. Similarly, the executable instructions are in machine language,interpreted languages, and/or other source code that will beinterpreted, such as, for example, C, C++, Visual Basic, Java,Smalltalk, Lisp, eXtensible Markup Language (XML), and the like.Moreover, it is to be appreciated that the storage medium/device 1000need not be co-located with any host system. That is, storagemedium/device 1000 may well reside within a remote servercommunicatively coupled to and accessible by an executing system.Accordingly, the software implementation of FIG. 10 is to be regarded asillustrative, as alternate storage media and software embodiments areanticipated within the spirit and scope of the present invention.

Although the invention has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the invention defined in the appended claims is not necessarilylimited to the specific features or steps described. Rather, thespecific features and steps are disclosed as example forms ofimplementing the claimed invention.

1. A method comprising: receiving a command from a decoder applicationat an application program interface (API), wherein the API is configuredto facilitate the use of a plurality of different multimediaaccelerators with the decoder application; and generating one or morefilter control command data structures, recognizable by acommunicatively coupled accelerator including one or more parameterswhich, when received by the accelerator, affects one or more filtersettings of the accelerator based, at least in part, on the content ofthe received command.
 2. A method according to claim 1, furthercomprising: passing the generated filter control command data structuresto the accelerator, wherein the accelerator modifies one or more filtersettings in accordance with the parameters embedded within the datastructure.
 3. A method according to claim 1, wherein the filter is apost-processing filter.
 4. A method according to claim 3, wherein outputdata subsequent to the application of a post-processing filter are usedas prediction references for decoding subsequent data.
 5. A methodaccording to claim 3, wherein the post-processing filter is one or moreof a deblocking filter and a de-ringing filter.
 6. A method according toclaim 1, wherein the parameters include a strength parameter.
 7. Amethod according to claim 6, wherein the generated data structureincludes a strength parameter for each of one or more block boundariesof a frame.
 8. A method according to claim 1, wherein the API issuesfilter control commands for each of a number of edges of luminance andchrominance blocks of received media content.
 9. A method according toclaim 1, wherein the API issues macroblock filter control command datastructures for each macroblock of video picture content, each macroblockfilter control command comprising four (4) or sixteen (16) luminanceblock filter control command data structures for controlling thefiltering of the luminance blocks of the macroblock, and/or two (2),four (4), eight (8), sixteen (16), or thirty-two (32) chrominance blockfilter control command data structures for controlling the filtering ofthe chrominance blocks of the macroblock.
 10. One or morecomputer-readable storage media having computer-readable instructionsstored thereon which, when executed by a computer, implement a methodaccording to claim
 1. 11. A system comprising: one or morecomputer-readable storage media; and computer-readable instructions onthe one or more computer-readable storage media which, when executed byone or more processors, implement a method according to claim
 1. 12. Oneor more computer-readable storage media having computer-readableinstructions stored thereon which, when executed by a computer,implement an application program interface (API) to dynamically generateone or more filter control command data structures in response to acommand received from a decoder application, wherein the one or morefilter control command data structure(s) include one or more parameterswhich, when received by a communicatively coupled accelerator, effectone or more filter settings on the accelerator in accordance with thereceived command, wherein the API is not specific to any particularmultimedia application and/or multimedia accelerator.
 13. A storagemedium according to claim 12, wherein the filter control command datastructure(s) effect one or more post processing filter(s) of theaccelerator.
 14. A storage medium according to claim 12, wherein thefilter control command data structure(s) effect one or more of adeblocking filter(s), de-ringing filter(s), and/or another postprocessing filter of the accelerator.
 15. A storage medium according toclaim 12, wherein the API issues a fitter control command data structurefor each of a number of edges of luminance and chrominance blocks ofreceived media content.
 16. A storage medium according to claim 15,wherein the API issues four (4) filter control command data structuresfor each luminance block, and/or two (2) filter control command datastructure(s) for each chrominance block.
 17. A storage medium accordingto claim 12, wherein the parameter(s) include a filter strengthparameter.
 18. A computing system comprising: a decoder application toprocess received media content; and an operating system including anapplication program interface (API), support the media processing,wherein the API generates one or more filter control commands includingone or more parameters which, when received by a communicatively coupledmedia processing accelerator, effect one or more filter settings of theaccelerator in accordance with a command received from the decoder,wherein the decoder application is configured to iteratively issueconfiguration commands reflecting various alternative degrees andmethods of decoding acceleration capability until choosing one tat isacceptable to both the decoder application and the accelerator.
 19. Acomputing system according to claim 18, further comprising: one or moremedia processing accelerator(s), communicatively coupled to the decoderapplication via the API, including one or more filter(s) responsive tothe filter control command data structures reflecting informationreceived in the command from the decoder.
 20. A computing systemaccording to claim 19, wherein the filter(s) are post processingfilters.
 21. A computing system according to claim 19, wherein thefilter(s) include one or more of a deblocking filter and de-ringingfilter.
 22. A computing system according to claim 18, wherein the APIissues macroblock filter control command data structures for eachmacroblock of video picture content, each macroblock filter controlcommand comprising four (4) or sixteen (16) luminance block filtercontrol command data structures for controlling the filtering of theluminance blocks of the macroblock, and/or two (2), four (4), eight (8), sixteen (16) or thirty-two (32) chrominance block filter controlcommand data structures for controlling the filtering of the chrominanceblocks of the macroblock.
 23. A computing system according to claim 18,wherein the filter control command data structures include a strengthparameter to control an amount of filter applied by a receiving filter.24. A computing system according to claim 18, further comprising: astorage medium having stored therein a plurality of executableinstructions; and an execution unit, coupled to the storage medium, toexecute at least a subset of the plurality of executable instructions toimplement the operating system and associated API.
 25. A computingsystem according to claim 24, wherein the execution unit executes atleast a subset of the plurality of executable instructions to implementthe decoder application.